[...path].ts 546 B

1234567891011121314151617181920
  1. import type { APIEvent } from "@solidjs/start/server"
  2. async function handler(evt: APIEvent) {
  3. const req = evt.request.clone()
  4. const url = new URL(req.url)
  5. const targetUrl = `https://dev.opencode.ai${url.pathname}${url.search}`
  6. const response = await fetch(targetUrl, {
  7. method: req.method,
  8. headers: req.headers,
  9. body: req.body,
  10. })
  11. return response
  12. }
  13. export const GET = handler
  14. export const POST = handler
  15. export const PUT = handler
  16. export const DELETE = handler
  17. export const OPTIONS = handler
  18. export const PATCH = handler